package libs

import (
	"github.com/gin-gonic/gin"
	"log"
	"wakitsoft.com/resume/errs"
)

func ValidateRequest[T any](c *gin.Context, obj *T) bool {
	if err := c.ShouldBindJSON(obj); err != nil {
		log.Println(err)
		Error(c, errs.BadRequest, "数据参数有误")
		return false
	}
	return true
}
